<?php

namespace App\Http\Controllers\Db;

use App\Models\Ioc;
use App\Models\Wxpay;
use App\Models\pay;
use App\Models\Alipay;
use App\Models\Role;
use App\Models\Student;
use App\Models\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;

class TestController extends Controller
{
    //
    public  function  db(){
//        dbphpinfo();
        /*$data = DB::connection("mysql")->select("select * from pcsoft_user where userid=:id",['id'=>1]);
        var_dump($data);
        */
       /* $data = Db::table("pcsoft_user")->select("username",'groupid',DB::raw("max(userid) as mid"))->groupBy("groupid")->get()->toArray();
        var_dump($data);
        Redis::set("a",111);
        $a = Redis::get("a");
        var_dump($a);*/
       $user = new User();
//       User::where(['id'=>39])->update(['name'=>999]);
       /*$u = $user->insert(
           [
               ['name'=>1,"email"=>'1'],
               ['name'=>2,"email"=>'2'],
               ['name'=>4,"email"=>'3']
           ]
       );


       var_dump($u);*/
       /* $user = new User();
       $data = $user->getA();
       var_dump($data);*/
       /*$role = new Role();
       $data = Role::find(1)->getStu();
       var_dump($data);*/

       $ioc = new Ioc();
       $ioc->bind("pay","WxPay");
       $ioc->bind("order","Order");
       //$ioc->bind("pay","WxPay");
       //$pay = $ioc->make("pay");
       $order = $ioc->make("order");
       //$pay->payment();
       $order->success();
    }
}
